package main

import (
	"fmt"

	"gitee.com/lyhmygo/middleware/solution/handler"
)

func main() {
	Two_number_add()
}

func ValidBracket() {
	validBracket := handler.ValidBracket{
		Str: "{[()]}",
	}
	b := validBracket.Arithmetic().(bool)
	fmt.Println(b)
}

func ListReversal() {
	listReversal := handler.ListReversal{
		Node: &handler.ListNode{
			Val: 1,
			Next: &handler.ListNode{
				Val: 2,
				Next: &handler.ListNode{
					Val:  3,
					Next: &handler.ListNode{},
				},
			},
		},
	}
	result := listReversal.Arithmetic2().(*handler.ListNode)
	for result.Next != nil {
		fmt.Print(result.Val, "\t")
		result = result.Next
	}
	fmt.Println()
}

func Two_number_subtract() {
	target := 7
	a := []int{1, 2, 3, 4, 5}
	result := handler.Two_number_subtract(a, target)
	fmt.Println(result)
}

func Two_number_add() {
	node := &handler.ListNode{
		Val: 1,
		Next: &handler.ListNode{
			Val: 2,
			Next: &handler.ListNode{
				Val: 3,
			},
		},
	}
	result := handler.Two_number_add(node, node)
	for result != nil {
		fmt.Print(result.Val, "\t")
		result = result.Next
	}
	fmt.Println()
}
